import request from '@/utils/request'

// 查询模板字段列表
export function listDcfield(query) {
  return request({
    url: '/project/ny/dcfield/list',
    method: 'get',
    params: query
  })
}

// 查询模板字段列表
export function zidingyiexport(data) {
  return request({
    url: '/project/ny/export/export',
    method: 'post',
    data: data
  })
}

// 查询模板字段详细
export function getDcfield(id) {
  return request({
    url: '/project/ny/dcfield/' + id,
    method: 'get'
  })
}

// 新增模板字段
export function addDcfield(data) {
  return request({
    url: '/project/ny/dcfield',
    method: 'post',
    data: data
  })
}

// 修改模板字段
export function updateDcfield(data) {
  return request({
    url: '/project/ny/dcfield',
    method: 'put',
    data: data
  })
}

// 删除模板字段
export function delDcfield(id) {
  return request({
    url: '/project/ny/dcfield/' + id,
    method: 'delete'
  })
}

// 获取字段
export function getfields(data) {
  return request({
    url: '/project/ny/dcfield/getfield',
    method: 'post',
    data: data
  })
}

// 获取字段
export function SearchField(databankName,templateNumber) {
  return request({
    url: '/project/ny/dcfield/getAllField/'+ databankName+"/" + templateNumber,
    method: 'get',
  })
}

// 提交模板数据到数据库
export function updateAllField(data) {
  return request({
    url: '/project/ny/dcfield/updateAllField',
    method: 'post',
    data: data
  })
}
